package niconama04.server;

import niconama04.client.RegistCategoryService;
import niconama04.model.impl.TransacterFactory;
import niconama04.shared.data.Category;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;


public class RegistCategoryServiceImpl extends RemoteServiceServlet implements RegistCategoryService {

	/** Serial Version */
	private static final long serialVersionUID = -3958916532732607224L;

	@Override
	public Category registServer(String x_name) throws Exception {
		Category category = null;
		try {
			category = new Category();
			category.setName(x_name);
			if ((x_name != null) && !x_name.trim().equals("")) {
				TransacterFactory.getInstance().getTransacter().registCategory(category);
			}
		} catch (Exception e) {
			e.printStackTrace();
			throw e;
		}
		return category;
	}
}
